Skip to content

$ variable sigil support - #44

Merged
milt merged 4 commits into
mainfrom
dolla_sign_sigil_support
Aug 20, 2026
Merged

$ variable sigil support#44
milt merged 4 commits into
mainfrom
dolla_sign_sigil_support

Conversation

@milt

@milt milt commented Aug 19, 2026

Copy link
Copy Markdown
Member

As mentioned in #42 we should support the $variable sigil in addition to the ?variable one we already know. Additionally ?abc and $abc refer to the same variable.

@milt
milt marked this pull request as ready for review August 20, 2026 18:36
@milt
milt merged commit 32c5168 into main Aug 20, 2026
2 checks passed
@milt
milt deleted the dolla_sign_sigil_support branch August 20, 2026 18:52
scope (set (mapcat vv/get-scope-vars prev-elems))]
(when (contains? scope bind-var)
scope (set (mapcat vv/get-scope-vars prev-elems))
scope-names (set (map p/variable-name scope))]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a set for scope is extra work for no reason.

Could use:

(->> prev-elems
     (mapcat vv/get-scope-vars)
     (map p/variable-name)
     set)

Or via transducing:

(into #{} 
     (comp (mapcat vv/get-scope-vars)
           (map p/variable-name))
     prev-elems)

(yes, I saw this is merged, sorry)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're totally right, I was rushing. I'll fix that up, thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually looking at this again I think perhaps the intermediate set was mainly for the error output (I just kind of followed @kelvinqian00's lead there), but the set part of that doesn't actually have to happen until we make the error below

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#47

scope (set (concat where-vars group-vars prev-vars))]
(if-some [bad-expr-vars (not-empty (filter #(not (scope %)) expr-vars))]
scope (set (concat where-vars group-vars prev-vars))
scope-names (set (map p/variable-name scope))]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, scope is only used to construct the scope-names set, and need not be a set

@milt milt mentioned this pull request Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants